package com.tudouji.project.permission.service;

import java.util.List;

import com.tudouji.framework.web.domain.AjaxResult;
import com.tudouji.project.organization.domain.Department;
import com.tudouji.project.permission.domain.Salespermission;
import com.tudouji.project.store.domain.Storeroom;
import com.tudouji.project.system.domain.SysDept;

/**
 * ����ϵͳȨ��Service接口
 * 
 * @author tudouji
 * @date 2021-04-23
 */
public interface ISalespermissionService 
{
    /**
     * 查询����ϵͳȨ��
     * 
     * @param guid ����ϵͳȨ��ID
     * @return ����ϵͳȨ��
     */
    public Salespermission selectSalespermissionById(String guid);

    /**
     * 查询����ϵͳȨ��列表
     * 
     * @param salespermission ����ϵͳȨ��
     * @return ����ϵͳȨ��集合
     */
    public List<Salespermission> selectSalespermissionList(Salespermission salespermission);

    /**
     * 新增����ϵͳȨ��
     * 
     * @param salespermission ����ϵͳȨ��
     * @return 结果
     */
    public int insertSalespermission(Salespermission salespermission);

    /**
     * 修改����ϵͳȨ��
     * 
     * @param salespermission ����ϵͳȨ��
     * @return 结果
     */
    public int updateSalespermission(Salespermission salespermission);

    /**
     * 批量删除����ϵͳȨ��
     * 
     * @param guids 需要删除的����ϵͳȨ��ID
     * @return 结果
     */
    public int deleteSalespermissionByIds(String[] guids);

    /**
     * 删除����ϵͳȨ��信息
     * 
     * @param guid ����ϵͳȨ��ID
     * @return 结果
     */
    public int deleteSalespermissionById(String guid);

    /**
     * 根据用户和 functiontype 和范围 获取权限
     * @param userid
     * @param functionType
     * @param scopeType 范围
     * @return
     * @throws Exception
     */
    public List<Salespermission> getPermByScAndFunc(String userid,String functionType,String scopeType);
    public List<Salespermission> getPermByScAndFuncSYS(Long userid,String functionType,String scopeType);


    public List<Department> getPermssionForDepart(String tuserId, String functionTypes, String departype)  throws Exception;


    public List<Storeroom> getPermssionForSr(String tuserId, String functionTypes);


    public List<Department> getDepsPermisByOrg(Salespermission per);


    public List<SysDept> getDepsByPermissionCode(Integer code, String deptStats);

    AjaxResult getPermis(Integer id);

    List<Storeroom> getUserOfSrbyPermssion(Storeroom storeroom);

    AjaxResult usertransfer(String transferType, Long userId, Long usertransferId, Long permission);

    /**
     * 权限移交
     * @param fromUserId
     * @param toUserId
     * @param picked
     * @return
     */
    AjaxResult trans(Long fromUserId,Long toUserId,String picked);

    /**
     * 根据用户id查询用户权限
     * @param userguid
     * @param permission
     * @return
     */
    List<Salespermission> selectPermissionByUserid(String userguid,Integer permission,Long deptId,String srguid,String orgid);

}
